import request from '@/utils/request'

const api = {
  query: '/admin/User/query',
  add: '/admin/User/add',
  status: '/admin/User/status',
  del: '/admin/User/del',
  changePassword: '/admin/User/changePassword',
  searchUser: '/admin/User/searchUser'
}

export function query (parameter) {
  return request({
    url: api.query,
    method: 'get',
    params: parameter
  })
}

export function add (parameter) {
  return request({
    url: api.add,
    method: 'post',
    data: parameter
  })
}

export function editStatus (parameter) {
  return request({
    url: api.status,
    method: 'post',
    data: parameter
  })
}

export function del (parameter) {
  return request({
    url: api.del,
    method: 'delete',
    data: parameter
  })
}

export function changePassword (parameter) {
  return request({
    url: api.changePassword,
    method: 'post',
    data: parameter
  })
}

export function searchUser (parameter) {
  return request({
    url: api.searchUser,
    method: 'get',
    params: parameter
  })
}
